import { fileURLToPath, URL } from "node:url";

import { defineConfig,loadEnv } from "vite";
import Components from "unplugin-vue-components/vite";
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
import vue from "@vitejs/plugin-vue";
import path from "node:path";
console.log(111,loadEnv('development','/'))
// https://vitejs.dev/config/
export default defineConfig({
  server:{
    port:8888,
    // 代理
    proxy:{
      '/api':{
        target:'http://localhost:2703',
        changeOrigin:true//是否允许跨域
      }
    }
  },
  plugins: [
    vue(),
    Components({
      resolvers: [
        AntDesignVueResolver({
          importStyle: false, // css in js
        }),
      ],
    }),
  ],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
